package yu.liu.personal.app.myapplication.utils;

import android.content.Context;
import android.database.sqlite.SQLiteDatabase;

import java.lang.ref.WeakReference;

/**
 * Created by yu.liu on 2016/10/10.
 */

public class DatabaseManager {
    private WeakReference<Context> refContext;

    private static DatabaseManager manager = null;

    private SQLiteDatabase databaseHelper;

    private DatabaseManager(Context context) {
        refContext = new WeakReference<>(context);
    }

    private static synchronized void syncInit(Context context) {
        if (manager == null) {
            manager = new DatabaseManager(context);
        }
    }

    public static DatabaseManager getManager(Context context) {
        if(manager == null) {
            syncInit(context.getApplicationContext());
        }
        return manager;
    }

    public void openOrCreateDB() {
    }

}
